package com.hualan.controller;

import com.hualan.domain.Course;
import com.hualan.domain.Teacher;
import com.hualan.service.KeChengService;
import com.hualan.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ke")

public class KeChengController {
    @Autowired
    private KeChengService keChengService;


    @GetMapping("/all")
    public R selAllTeacher(){
        List<Teacher> list=keChengService.AllTeacherService();
        return R.success(list);
    }


    @GetMapping("/all2")
    public R selAllCourse(){
        List<Course> list=keChengService.AllCourseService();
        return R.success(list);
    }
    @GetMapping("/like")
    public R selLikeCourse(String coursename){
        List<Course> courseList=keChengService.LikeCourseService(coursename);
        return R.success(courseList);

    }
}
